﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Gfw.Infrastructure.Stock.Facilities;
using Gfw.Models.Account;

namespace Gfw.BLL.Basic.Stock.Facilities
{
    /// <summary>
    /// 转账到股票帐户，这里应该判断是否满足自动买入股票
    /// </summary>
   public class ToStockMoneyFacilityImpl : ToStockMoneyFacility
    {
        public ToStockMoneyFacilityImpl(ActUserAccountinformation userAccount, decimal count) : base(userAccount, count)
        {
        }

        public ToStockMoneyFacilityImpl(string userId, decimal count) : base(userId, count)
        {
        }

        public override void Execute(Repository.UnitOfWork unitOfWork = null)
        {
            base.Execute(unitOfWork);

            if (unitOfWork == null)
            {
                //这里转账到了股票帐户
                AutoBuyFacility abf = new AutoBuyFacility(_userAccount.Userid);
                abf.Execute();
            }
        }
    }
}
